from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from changliang import LUJING


wd = webdriver.Chrome(service=Service(LUJING))
wd.implicitly_wait(10)

wd.get('https://www.byhy.net/cdn2/files/selenium/jsweather.html#')

forecast= wd.find_element(By.ID,'forecastID')
# list1 = forecast.find_elements(By.TAG_NAME,'dl')

# ll_wendu = 1000
# city_list = []
# for i in list1:
#     city_info = i.find_elements(By.TAG_NAME,'a')
#     city_name = city_info[0].text
#     l_wendu = city_info[2].text[:2]
#     h_wendu = city_info[3].text[:2]
   
#     if int(l_wendu) < ll_wendu:
#         ll_wendu = int(l_wendu)
#         city_list.clear()
#         city_list.append(city_name)
#     elif int(l_wendu) == ll_wendu:
#         city_list.append(city_name)
    
# print(f'最低温度是：{ll_wendu}度，城市有{city_list}')
print(forecast.text)
#然后对文本进行处理

# wd.quit()

